﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using AIStudio.Wpf.DiagramDesigner;
using AIStudio.Wpf.DiagramDesigner.Geometrys;
using AIStudio.Wpf.DiagramDesigner.Models;

namespace AIStudio.Wpf.Mind.ViewModels
{
    public class MindNode : DesignerItemViewModelBase
    {
        public MindNode(NodeLevel nodeLevel) : this(null, nodeLevel)
        {

        }

        public MindNode(IDiagramViewModel root, NodeLevel nodeLevel) : base(root)
        {
            NodeLevel = nodeLevel;
        }

        public MindNode(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer)
        {
        }

        public MindNode(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType)
        {
        }

        [Browsable(false)]
        public NodeLevel NodeLevel
        {
            get; set;
        }

        private double _cornerRadius = 3;
        public double CornerRadius
        {
            get
            {
                return _cornerRadius;
            }
            set
            {
                SetProperty(ref _cornerRadius, value);
            }
        }

        public double Spacing
        {
            get; set;
        }

        public List<MindNode> Children
        {
            get; set;
        }

  

     
    }

    public class MindLevel1Node : MindNode
    {
        public MindLevel1Node() : this(null)
        {

        }

        public MindLevel1Node(IDiagramViewModel root) : base(root, NodeLevel.Level1)
        {

        }

        public MindLevel1Node(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer)
        {

        }

        public MindLevel1Node(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType)
        {

        }

        public void LayoutUpdated()
        {
            foreach(var child in Children)
            {

            }
        }

        public RectangleBase Rectangle
        {
            get; set;
        }

        //public RectangleBase GetChildRectangle()
        //{
        //    //Children.Select(p => p.Size)
        //}
    }

    public class MindLevel2Node : MindNode
    {
        public MindLevel2Node() : this(null)
        {

        }

        public MindLevel2Node(IDiagramViewModel root) : base(root, NodeLevel.Level2)
        {

        }

        public MindLevel2Node(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer)
        {

        }

        public MindLevel2Node(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType)
        {

        }

        public PointBase Offset
        {
            get; set;
        }
    }

    public class MindLevel3Node : MindNode
    {
        public MindLevel3Node() : this(null)
        {

        }

        public MindLevel3Node(IDiagramViewModel root) : base(root, NodeLevel.Level2)
        {

        }

        public MindLevel3Node(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer)
        {

        }

        public MindLevel3Node(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType)
        {

        }

        public PointBase Offset
        {
            get; set;
        }
    }
}
